package demo02;

public class Demo04StringConvert {
    public static void main(String[] args) {
        String str = "abc";
//        -------------------------------
        char[] chars = str.toCharArray();
        for (int i = 0; i < chars.length; i++) {
            System.out.println(chars[i]);
        }
//        -------------------------------
        byte[] bytes = str.getBytes();
        for (int i = 0; i < bytes.length; i++) {
            System.out.println(bytes[i]);
        }
//        -------------------------------
        String str2 = str.replace("bc", "def");
        System.out.println(str2);
    }
}
